/*
* @Description:合约管理-详情
* @Author: lil
* @Date: 2021/11/24
**/
<template>
  <div class="cm-detail">
    <div style="white-space: pre-wrap;" v-if="data.length>0">{{data[0].data}}</div>
  </div>
</template>
<script>
  import {
    showDetail
  } from '@/api/blockchain/blockchaindeploy'
  export default {
    props: ['versionCode', 'chainCodeName'],
    data() {
      return {
        data: []
      };
    },
    mounted() {
      this.getChaincodeDetail();
    },
    methods: {
      getChaincodeDetail() {
        showDetail(this.chainCodeName, this.versionCode).then((res) => {
          this.data = [];
          this.data.push({
            "data": res.data.replace(/\r\t\n/g, "<br/>")
          });
        }).catch((err) => {
          console.log(err);
        });
      }
    },
  };

</script>
<style lang="scss" scoped>
  .cm-detail {
    min-height: 400px;
  }

</style>
